Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the documentation framework #1891

Closed
wants to merge 11 commits into from
Closed

Update the documentation framework #1891

wants to merge 11 commits into from

Conversation

ethomson
Copy link
Contributor

@ethomson ethomson commented Oct 2, 2020

This is a backport of #1915 to the v6 branch.

Some updates to the documentation framework (the scripts that build and display docs) to both make them a little shinier and easier to work with, and to help align these docs with the npm registry documentation. (The npm registry documentation includes these docs as a subset, so there are some changes to make them more easily consumable.)

  1. Drop Gatsby. For our needs, it's big and slow, and it produces complex content. Introduce a new application "dockhand" that takes our markdown content, converts that to HTML, puts that in a simple template, and does some minor translations. The output is standalone HTML files with zero external dependencies.

  2. An update to the docs-build.js manpage generation script to parse data out of the frontmatter of the documentation pages, instead of parsing the documentation content. Moving this to metadata makes the content focused on the display, and the frontmatter is focused on the metadata.

  3. Update the documentation itself to move the metadata into frontmatter.

  4. Move the commands directory to commands (instead of cli-commands). Since they're in the cli repo, it's clear that they're cli commands. 😀

  5. Fix a few broken links, and a few typos.

Aside from (5), there are no changes to the documentation content itself.

@ethomson ethomson requested a review from a team as a code owner October 2, 2020 15:56
@darcyclarke darcyclarke added the Release 7.x work is associated with a specific npm 7 release label Oct 6, 2020
@darcyclarke darcyclarke added this to the OSS - Sprint 17 milestone Oct 6, 2020
@ethomson ethomson added Release 6.x work is associated with a specific npm 6 release and removed Release 7.x work is associated with a specific npm 7 release labels Oct 7, 2020
Copy link
Contributor

@darcyclarke darcyclarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update the reference to cli-commands in ./lib/help.js so we don't break npm help.

I sent you some other feedback internally about the other issues with routing when viewing the docs statically but generally, the docs that are bundled with the CLI should be able to be viewed/navigated, I think, without requiring a server to be spun up/down.

@ethomson
Copy link
Contributor Author

@darcyclarke I updated this based on how #1915 landed and included 77ad86b

@ruyadorno ruyadorno added the semver:patch semver patch level for changes label Nov 3, 2020
@darcyclarke darcyclarke removed this from the OSS - Sprint 17 milestone Nov 4, 2020
ethomson and others added 11 commits December 1, 2020 10:44
Update the `docs-build.js` script to parse the name, man page section,
and description out of the frontmatter and use that for the generated
man page.  This helps avoid repetition between the frontmatter section
and the body of the page itself.

Update the docs pages themselves to remove the H1 (title) and H2
(description).  Finally, ensure that the frontmatter begins in column
0 on each page.
Gatsby's markdown parser doesn't like code blocks spread over multiple
lines.
Avoid needless and unnecessary redundancy.
These links now reflect the reality of the filesystem and their paths.
Update links to reflect where the pages actually are.
Drop Gatsby, use a simplified custom static site generator that uses GFM
and a template for extremely lightweight docs.
This also reduces the publish file size rather considerably.
Conform to the norm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release 6.x work is associated with a specific npm 6 release semver:patch semver patch level for changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants